package suzf.top.goodscenter.data.repository

import rx.Observable
import suzf.top.base.data.net.RetrofitFactory
import suzf.top.base.data.protocol.BaseResp
import suzf.top.goodscenter.data.api.CategoryApi
import suzf.top.goodscenter.data.protocol.Category
import suzf.top.goodscenter.data.protocol.GetCategoryReq
import javax.inject.Inject

/**
 *  用户网络请求
 *========================
 * Created with AndroidStudio
 * Author:Mr.Su
 * Date:2019-09-08
 * Time:14:38
 * ========================
 */
class CategoryRepository @Inject constructor() {

    fun getCategory(parentId: Int): Observable<BaseResp<MutableList<Category>?>> {
        return RetrofitFactory.instance.create(CategoryApi::class.java)
                .getCategory(GetCategoryReq(parentId))
    }
}